{% extends "_base.html" %}
{% block title %}登录页面{% endblock %}
{% block script %}
<script type="text/javascript" src="/static/script/Validate.js"></script>
<script>
$(function(){
    
    // 表单检查项
    form_list = {
        "#form-username" : check_username,
        "#form-passwd" : check_passwd
    };
    
    // 提交按钮
    $( "#form-submit" ).button().click(function(){
        res = check_form(form_list);
        if( !res ){
            $("#dialog p").text("您有未填写完整的选项。");
            $("#dialog").dialog("open");
            return false;
        }
    });
    
    // 表单检查
    check_by_dict(form_list);
});
</script>
{% endblock %}
{% block content %}
<form id="normal-form" action="/passport/loginproc" method="post">
    <input type="hidden" name='path' value="{{path}}">
    <div class="input-row">
        <label class="input-label" for="username">用户名</label>
        <input class="input-text" type="text" id="form-username" name="username" />
    </div>
    <div class="notice-row">
        <label class="notice-label">用户名为小写字母和数字组合（字母开头），长度6-20之间</label>
    </div>
    <div class="input-row">
        <label class="input-label" for="passwd">密码</label>
        <input class="input-text" type="password" id="form-passwd" name="passwd" />
    </div>
    <div class="notice-row">
        <label class="notice-label">密码不能为中文，长度6-20之间</label>
    </div>
    <div class="submit-row">
        <input id='form-submit' type="submit" value="登录" />
    </div>
</form>
{% endblock %}
